home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 038a / bprep101.zip / BPREP.DOC < prev    next >
Text File  |  1991-09-18  |  19KB  |  713 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.                                    BPREP
  16.  
  17.                 A preprocessor utility for the BASIC language
  18.  
  19.                                Version  1.01
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.        [c] 1991 Applied Design Group, E 3707 Pacific, Spokane, WA 99202
  51.  
  52.                                (509) 535-7829
  53.  
  54.  
  55.  
  56.  
  57.  
  58.                         Table Of Contents
  59.                 ____________________________________
  60.  
  61.  
  62.             License Policy                              1
  63.  
  64.             Disclaimer                                  2
  65.  
  66.             Introduction                                3
  67.  
  68.             Compatibility                               4
  69.  
  70.             Using BPREP                                 5
  71.  
  72.             The Directives                              6
  73.  
  74.                     #include                            7
  75.                     #define                             8
  76.                     #undef                             10
  77.                     #ifdef                             11
  78.                     #ifndef                            12
  79.                     #endif                             13
  80.  
  81.             Professional Version                       14
  82.  
  83.             Registration Information                   15
  84.  
  85.             Other Applied Design Group Products        16
  86.  
  87.             Order Form
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94. License Policy:                                                 Page 1
  95.  
  96.  
  97.  
  98.      BPREP and its documentation are copyright [c] 1991 Applied Design Group
  99.      all rights reserved.  BPREP may not be circulated in any incomplete
  100.      or modified form, nor sold for profit, without written permission
  101.      of the author.  You may use the unregistered shareware version of
  102.      BPREP for a reasonable evaluation period.  After the evaluation
  103.      period, you must either register BPREP or discontinue its use.  If
  104.      you register BPREP, you may continue to use the unregistered BPREP
  105.      program until you receive the registered version.
  106.  
  107.  
  108.  
  109.      If you distribute this software to others, you are required to
  110.      distribute the ENTIRE package consisting of the following files:
  111.  
  112.                BPREP.EXE      -    BASIC Preprocessor
  113.                BPREP.DOC      -    BPREP Documentation
  114.                README         -    Read file
  115.                SAMPLE.B       -    Sample source file
  116.                SAMPLE.INC     -    Sample include file
  117.                SAMPLE.BAS     -    Sample file processed with BPREP
  118.                BP.BAT         -    batch file to run BPREP
  119.  
  120.  
  121.  
  122.  
  123.  
  124. Commercial sale:
  125.  
  126.      Any software dealer or library may distribute the entire
  127.      BPREP Shareware package in an unmodified form for a fee as long as the
  128.      price charged for the disk containing BPREP Shareware does
  129.      not exceed US $10.00.
  130.  
  131.      With this single exception, the sale of BPREP or its parts for profit,
  132.      either alone or together with other software or hardware, requires a
  133.      licensing agreement providing for royalty payments.  Please write for
  134.      terms.
  135.  
  136.  
  137.  
  138. Disclaimer:                                                     Page 2
  139.  
  140.  
  141.  
  142.  
  143.  
  144.      This software (BPREP Shareware) is provided on an "as is" basis without
  145.  
  146.      warranty of any kind, expressed or implied, including but not limited
  147.  
  148.      to the implied warranties of merchantability and fitness for a
  149.  
  150.      particular purpose.  The person using the software bears all risk as to
  151.  
  152.      the quality and performance of the software.  Should the software
  153.  
  154.      prove defective, the user assumes the entire cost of all necessary
  155.  
  156.      repair, servicing, or correction.  The author will not be liable for
  157.  
  158.      any special, incidental, consequential, indirect or similar damages
  159.  
  160.      due to loss of data or any other reason, even if the author or an
  161.  
  162.      agent of the author has been advised of the possibility of such
  163.  
  164.      damages.  In no event shall the author's liability for any damages
  165.  
  166.      ever exceed the price paid for the license to use the software,
  167.  
  168.      regardless of the form of the claim.
  169.  
  170.  
  171.  
  172. Introduction                                                    Page 3
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186. BPREP 1.01
  187.  
  188.  
  189.  
  190.  
  191. BPREP is a preprocessor for the BASIC language.  It adds features
  192.  
  193. usually lacking in most versions of BASIC.  With BPREP you can have
  194.  
  195. conditional compilation, include files and defined constants.  If you are
  196.  
  197. a C programmer you will probably recognize the syntax.  If you have never
  198.  
  199. used a preprocessor before you will soon be wondering how you ever got
  200.  
  201. along without one.  This is a shareware product,  you may try BPREP to see
  202.  
  203. if it fits your needs.  If after a reasonable period of time you find you
  204.  
  205. are still using BPREP you must register.  By registering this product
  206.  
  207. you will receive the professional version which includes many additional
  208.  
  209. features you will also recieve a printed manual, technical support and
  210.  
  211. a subscription to our quarterly newsletter for  one year.
  212.  
  213.  
  214. Alternatively you may register the version which you have at a lower
  215.  
  216. cost and recieve the printed manual and technical support.
  217.  
  218.  
  219.  
  220. Compatibility                                                   Page 4
  221.  
  222.  
  223.  
  224.  
  225.  
  226. BPREP can be used with almost any BASIC product that can take input from
  227.  
  228. a normal ascii file.  This includes but is not limited to the following.
  229.  
  230.  
  231.  
  232.                         Turbo Basic
  233.  
  234.                         Power Basic
  235.  
  236.                         QuickBasic   3.0
  237.  
  238.                         QuickBasic   4.0
  239.  
  240.                         QuickBasic   4.5
  241.  
  242.                         GW Basic
  243.  
  244.                         MEQ Basic    (Mars Electronics)
  245.  
  246.                         Intel MCS BASIC 52
  247.  
  248.  
  249.  
  250.  
  251.  
  252. If there is a question of compatibility just drop us a line or call
  253.  
  254. 8:00 AM to 5:00 PM Pacific Time.
  255.  
  256.  
  257.                         Applied Design Group
  258.  
  259.                            (509) 535-7829
  260.  
  261. Using BPREP                                                     Page 5
  262.  
  263.  
  264. BPREP takes two arguments from the command line, an input file name and
  265. an output file name.  We suggest using  "B" as an extension for your
  266. source files and "BAS" for the output files, although anything will work
  267.  
  268.  
  269.         ie:
  270.  
  271.                     BPREP myfile.b myfile.bas
  272.  
  273.  
  274.                     myfile.b :
  275.  
  276.                         #define SUM 3+4
  277.                         print SUM
  278.  
  279.  
  280.                     myfile.bas
  281.  
  282.                         print 3+4
  283.  
  284.  
  285.  
  286. so the command line syntax is
  287.  
  288.     BPREP infile outfile
  289.  
  290.  
  291. if you leave off the outfile name BPREP will write to the screen, useful
  292. to see what's going on.
  293.  
  294. #defined names must start with a letter and can consist of numbers,
  295. letters and the underscore "_" character.  Length of names is limited by
  296. memory and common sense.
  297.  
  298.                         Valid names
  299.                         -----------
  300.  
  301.                         TEST_1
  302.                         Version1
  303.                         Version_1_2_3
  304.                         DISTRIB
  305.                         Abcdefgjijklmnopqrstuvwxyz1234567890_____________
  306.  
  307.  
  308.  
  309.                                                                 Page 6
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.                              The Directives
  321.  
  322.  
  323.  
  324.             BPREP shareware supports the following directives:
  325.  
  326.  
  327.                                 #include
  328.                                 #define
  329.                                 #undef
  330.                                 #ifdef
  331.                                 #ifndef
  332.                                 #endif
  333.  
  334.  
  335.  
  336. #include                                                        Page 7
  337.  
  338. SYNTAX      :  #include myfile.inc
  339.  
  340. OPERATION   :  The #include directive does not allow quotes around the file
  341.  
  342.                The included file will be opened and processed and can
  343.                include preprocessor directives.  The ouput will be a single
  344.                combined file of all included files.   Include files can
  345.                be nested to a depth of 4 in the SHAREWARE version. In the
  346.                PROFESSIONAL version the number of include files  is
  347.                limited only by available memory and disk space.
  348.  
  349.  
  350.  
  351.  
  352. #define                                                         Page 8
  353.  
  354. SYNTAX      :  #define name definition
  355.  
  356. OPERATION   :  The define directive allows you to replace constants with
  357.                meaningful symbolic names and to define symbols to be
  358.                used with the conditional compilation directives (see
  359.                below).  The name can be any legal basic variable name
  360.                although we suggest using upper case names for defined
  361.                constants and lower and uppercase mixture or lowercase
  362.                only for variables. ie
  363.  
  364.                         #define COMM_PORT 1000
  365.  
  366.                         current_comm_port = COMM_PORT
  367.  
  368.                In the shareware version of BPREP definitions are limited
  369.                to string constants so the following:
  370.  
  371.                             #define SUM 3+4
  372.  
  373.                             sumvar = SUM + 6
  374.  
  375.                      will translate to:
  376.  
  377.                             sumvar = 3+4 + 6
  378.  
  379.  
  380.                 Any text in string literals or comments is left
  381.                 completely intact:
  382.  
  383.                         #define DEFINE "#define"
  384.                         print DEFINE
  385.  
  386.                 becomes:
  387.                         print "#define"
  388.  
  389.  
  390.  
  391.                                                                 Page 9
  392.  
  393.  
  394.                 Names cannot be defined twice to change the value of a
  395.                 #define'd name #undef it first.
  396.  
  397.                         #define SUM 3+4
  398.                         #define SUM 4+5     --- ERROR
  399.  
  400.                         #define SUM 3+4
  401.                         #undef  SUM
  402.                         #define SUM 4+5     --- OK
  403.  
  404.  
  405.                 Names can be used in the expression of a #define
  406.                 statement.
  407.  
  408.                 ie:
  409.                         #define  FIRSTNAME "John"
  410.                         #define  LASTNAME  "Smith"
  411.  
  412.                         #define  NAME    FIRSTNAME + " " + LASTNAME
  413.  
  414.                         name$ =  NAME
  415.  
  416.                 becomes:
  417.  
  418.                         name$ =  "John"+" "+"Smith"
  419.  
  420.  
  421.  
  422.                 If constant expression evaluation is a feature you
  423.                 would like to have then consider purchasing the
  424.                 professional version.
  425.  
  426.                 ie:  (in the PROFESSIONAL VERSION ONLY )
  427.  
  428.                         #define SUM 3+4
  429.                         var = SUM       : becomes var = 7
  430.  
  431.  
  432.  
  433. #undef                                                          Page 10
  434.  
  435. SYNTAX      :  #undef name
  436.  
  437. OPERATION   :  The name is removed from the symbol table further
  438.                references to the name will be ignored.  Use the
  439.                #undef directive to redefine a #defined'd name.
  440.  
  441.  
  442. #ifdef                                                          Page 11
  443.  
  444. SYNTAX      :  #ifdef name
  445.                 ...
  446.                 ...
  447.  
  448.                #endif
  449.  
  450.  
  451. OPERATION   :  The #ifdef directive is used for conditional compilation
  452.                if the name is found the code up until the #endif
  453.                directive is emmitted to the output file, if the symbol
  454.                is not found then no code is emmitted until the #endif is
  455.                reached.
  456.  
  457.  
  458.                example:
  459.  
  460.                         #define VER1
  461.  
  462.                         #ifdef VER1
  463.                             print "My Program Ver 1.0"
  464.                         #endif
  465.  
  466.                         #ifdef VER2
  467.                             print "My Program Ver 2.0"
  468.                         #endif
  469.  
  470.                output:
  471.                         My Program Ver 1.0
  472.  
  473.  
  474.               The shareware version allows #ifdef's and #ifndefs
  475.               to be nested to 8 levels
  476.  
  477.               ie:
  478.                         #ifdef VER1
  479.                         #ifdef UPDATE1
  480.                             print "My Program Ver 1.0 update 1.0"
  481.  
  482.                         #endif
  483.                         #endif
  484.  
  485.  
  486.               if deeper nesting is required the professional version
  487.               allows virtually unlimited nesting.
  488.  
  489.  
  490. #ifndef                                                         Page 12
  491.  
  492. SYNTAX      :  #ifndef name
  493.                 ...
  494.                 ...
  495.  
  496.                #endif
  497.  
  498.  
  499. OPERATION   :  The #ifndef directive is used for conditional compilation
  500.                if the name is not found the code up until the #endif
  501.                directive is emmitted to the output file, if the symbol
  502.                is found then no code is emmitted until the #endif is
  503.                reached.
  504.  
  505.  
  506.  
  507. #endif                                                          Page 13
  508.  
  509. SYNTAX      :  #endif
  510.  
  511. OPERATION   :  #endif terminates an #ifdef or #ifndef block
  512.  
  513.  
  514.  
  515.  
  516. Professional Version                                            Page 14
  517.  
  518.  
  519.  
  520.  
  521.  
  522. The professional version includes the following additional features:
  523.  
  524.  
  525.  
  526.  
  527.  
  528.   Constant expression evaluation : defines can be arithmetic expressions
  529.                                    as well as strings.
  530.  
  531.  
  532.   Nested conditional directives  : unlimited nesting of   #ifdef,
  533.                                    #ifndef, etc.
  534.  
  535.  
  536.   Case sensitivity switch, case sensitive code generation.
  537.  
  538.  
  539.  
  540.   Line number generation for line number basics.
  541.  
  542.  
  543.  
  544.   The following additional directives:
  545.  
  546.                             #if
  547.                             #else
  548.                             #elseif
  549.                             #repeat
  550.                             #macro
  551.                             #endm
  552.                             #local
  553.                             #display
  554.                             #error
  555.                             #fatal
  556.                             #date
  557.                             #time
  558.                             #conds
  559.                             #noconds
  560.                             #defs
  561.                             #nodefs
  562.  
  563.  
  564. Registration Information                                        Page 15
  565.  
  566.  
  567.  
  568.  
  569.  
  570.         BPREP is NOT FREE Software.  If you wish to continue using BPREP
  571.         you must register.
  572.  
  573.  
  574.  
  575.  
  576.  
  577.         Q : What do I get if I register ?
  578.  
  579.         A : BPREP Shareware is a complete and usable program as is
  580.             however, by registering you will recieve the latest version
  581.             of BPREP Professional the enhanced BASIC Preprocessor which
  582.             includes many additional features not found in
  583.             BPREP Shareware.  So this is what you will recieve
  584.  
  585.  
  586.                         - BPREP Professional on disk
  587.                         - A Printed manual
  588.                         - Unlimited Technical Support
  589.                         - Quarterly Newsletter
  590.                                (for 1 year)
  591.  
  592.                                                              $24.95
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.         Q : I'd like to register for the technical support and manual
  600.             but  I don't need the power of BPREP Professional.
  601.  
  602.         A : You can register your copy of BPREP Shareware and receive
  603.             the printed manual and technical support for only:
  604.  
  605.                                                               $9.95.
  606.  
  607.  
  608.  
  609.  
  610. Other Applied Design Group Products                             Page 16
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617. ASM51 8051/8031 Macro Cross Assembler
  618.  
  619.         A full featured Cross Assembler for the Intel 8051/8031
  620.         series of microprocessors.  Generates Intel HEX files or
  621.         binary image output.
  622.                                                          $39.95
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630. BAS51 8051/8031 Basic Cross Compiler
  631.  
  632.         A BASIC compiler for the 8051 that supports most features
  633.         of the BASIC language.  Use structured contstructs
  634.         while/wend, do/loop, block if/then.  Generates good tight
  635.         code and no line numbers are required. Get those 8051
  636.         projects done in less time.
  637.  
  638.                                                          $99.95
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645. BAS51 Professional
  646.  
  647.         A complete package including BAS51 Compiler, ASM51 Assembler
  648.         and BPREP Professional, as well as several other utilities to
  649.         help you write 8051 code.
  650.                                                         $149.95
  651.  
  652.  
  653.  
  654.  
  655.    BPREP version 1.01                                     Order Form
  656.    -----------------------------------------------------------------
  657.      Make checks payable to:
  658.        Applied Design Group
  659.        E 3707 Pacific
  660.        Spokane, WA 99202
  661.    -----------------------------------------------------------------
  662.    Qty
  663.  
  664.    [ ] BPREP Shareware                   @   $9.95 each      $______
  665.  
  666.    [ ] BPREP Professional                @  $24.95 each      $______
  667.  
  668.    [ ] ASM51
  669.        8051/8031 Macro Cross Assembler   @  $39.95 each      $______
  670.  
  671.    [ ] BAS51
  672.        8051/8031 Basic Cross Compiler    @  $99.95 each      $______
  673.  
  674.    [ ] BAS51 Professional
  675.        8051/8031 Basic Cross Compiler
  676.        Includes Macro Assembler
  677.        and BPREP Professional            @ $149.95 each      $______
  678.  
  679.                                                 Subtotal     $______
  680.  
  681.        Washington residents please add 8.0% sales tax.       $______
  682.  
  683.        Shipping and handling                                   $3.50
  684.  
  685.                                                      Total   $______
  686.  
  687.        Diskette type :  [ ] 5.25"         [ ] 3.5"
  688.  
  689.        Payment       :  [ ] Check         [ ] Money Order
  690.  
  691.    Checks and Money Orders must be drawn on U.S. banks in U.S. funds
  692.    -----------------------------------------------------------------
  693.  
  694.    Name      _______________________________________________________
  695.  
  696.    Company   _______________________________________________________
  697.  
  698.    Address   _______________________________________________________
  699.  
  700.              _______________________________________________________
  701.  
  702.    Phone     _____________________  Business  ______________________
  703.  
  704.  
  705.    Where did you obtain BPREP?
  706.  
  707.              _______________________________________________________
  708.  
  709.    Comments  _______________________________________________________
  710.  
  711.              _______________________________________________________
  712.  
  713.